package com.ccs.lotterySystem.common.exception;

import com.ccs.lotterySystem.common.errorcode.ErrorCode;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class ServiceException extends RuntimeException{
    private int code;
    private String message;

    public ServiceException(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public ServiceException(){}

    public ServiceException(ErrorCode errorCode){
        this.code= errorCode.getCode();
        this.message= errorCode.getMessage();
    }



}
